package cn.haoxsf.app.system.model.param;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.TokenBufferSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author Ele  qvbanfm@qq.com
 * @since 2020-03-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderParam {

    private static final long serialVersionUID = 1L;
    /**
     * 实际付款金额,单位是元,保留两位小数
     */
    @NotNull(message = "实际付款金额，不能为空")
    @ApiModelProperty(value = "订单金额 单位是元 - 从getCost接口获取",required = true,example = "30")
    @JsonSerialize(using = TokenBufferSerializer.class)
    private BigDecimal payment;

    /**
     * 订单有效时间
     */
    @NotNull(message = "订单有效时间，不能为空")
    @ApiModelProperty(value = "订单有效时间",required = true,example = "2018-09-29 13:55:30")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expirationTime;

    /**
     * 上门时间
     */
//    @ApiModelProperty(value = "上门时间",required = true,example = "2018-09-29 13:55:30")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date startTime;
    @NotNull(message = "故障分类id，不能为空")
    @ApiModelProperty(value = "故障分类id",required = true)
    private String categoryId;
    /**
     * 故障id
     */
    @NotNull(message = "故障id，不能为空 支持多个id")
    @ApiModelProperty(value = "故障id",required = true)
    private String faultId;

    /**
     * 故障名称
     */
    @NotNull(message = "故障名称，不能为空")
    @ApiModelProperty(value = "故障名称",required = true)
    private String faultName;

    /**
     * 商品图片地址
     */
    @NotNull(message = "故障图片，不能为空")
    @ApiModelProperty(value = "故障图片id-注意不能是假的的数据必须调用上传接口获取到id支持多个id 例如：111,222最两个，对应上传接口的finalName字段",required = true)
    private String faultImageId;

    /**
     * 地址 用于更新用户地址
     */
    @NotNull(message = "地址，不能为空")
    @ApiModelProperty(value = "地址 ",required = true)
    private String address;
    /**
     * 电话 用于更新用户电话
     */
    @Pattern(regexp = "^1[3|4|5|7|8][0-9]\\d{8}",message = "手机号为空;或者号码不正确")
    @ApiModelProperty(value = "电话",required = true)
    private String phone;
    /**
     * 短信验证码
     */
//    @NotNull(message = "短信验证码")
//    @ApiModelProperty(value = "短信验证码",required = true,example = "6668")
//    private String sms;


    /**
     * latitude
     */
    @ApiModelProperty(value = "latitude",required = true,example = "3.3")
    private Double latitude;

    /**
     * longitude
     */
    @ApiModelProperty(value = "longitude",required = true,example = "2.2")
    private Double longitude;
    @ApiModelProperty(value = "故障描述-可为空")
    private String faultMessage;
    /**
     * 指定商户
     */
    @ApiModelProperty(value = "指定商户id（师傅）为空不可传参数",example = "")
    private String businessId;
}
